﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TestPages_TopTenWordsTextPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void submitButton_Click(object sender, EventArgs e)
    {
        string[] top10Words = new string[10];
        TopTenWordsService.TextAnalysisServiceClient client = 
            new TopTenWordsService.TextAnalysisServiceClient();
        top10Words = client.Top10Words(this.urlTextBox.Text);
        if (top10Words != null && top10Words.Length != 0)
        {
            string words = "";
            foreach (string word in top10Words)
            {
                words += word;
                words += ", ";
            }
            this.output.InnerText = "Top Ten Words: " + words;
        }
        else
        {
            this.output.InnerText = "No Output :-(";
        }
    }
}